home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 15807 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: ub239.dialup.uwa.edu.au!localhost!prye
  2. From: prye@cyllene.uwa.edu.au (Peter Rye)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: 2D pointer array to class overwritten
  5. Date: 08 Apr 1996 05:28:57 GMT
  6. Organization: The University of Western Australia
  7. Message-ID: <PRYE.96Apr8132857@cyllene.uwa.edu.au>
  8. References: <4k89ap$7fl@ctylnk.cityu.edu.hk> <9604071928.AA001og@lorelei.demon.co.uk>
  9. NNTP-Posting-Host: ub239.dialup.uwa.edu.au
  10. In-reply-to: John Croudy's message of Sun, 7 Apr 96 19:28:01 GMT
  11. X-Mailer: GNU Emacs 19.28
  12.  
  13. >>>>> "John" == John Croudy <john@lorelei.demon.co.uk> writes:
  14.  
  15.     John> On 7 Apr 1996 11:35:53 GMT, 92907308@cpccux0.cityu.edu.hk
  16.     John> wrote:
  17.     >> cout << " "<< ptr[i,j];
  18.  
  19.     John> I'm sure I'm not the only one who spotted the [i,j] instead
  20.     John> of [i][j].
  21.  
  22.     John> But why doesn't the compiler at least warn about this? I
  23.     John> tried and couldn't get a warning out of GNU.
  24.  
  25. I believe this is perfectly legal syntax.
  26. It means the same as ptr[j]. (Not that that was what was intended).
  27. --
  28. Peter Rye   prye@cyllene.uwa.edu.au,  prye@ichr.uwa.edu.au
  29. Respiratory Research Fellow, Princess Margaret Hospital for Children
  30. Perth, Western Australia    Ph: +61 (09) 340 8985, Fax: +61 (09) 388 2097
  31. ** Smoking areas in restaurants are like peeing areas in swimming pools. **
  32.